package com.gqr.springcloud;

import com.gqr.springcloud.rules.MyRule;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
//@RibbonClient(name="eureka-client",configuration=com.netflix.loadbalancer.RandomRule.class)
@RibbonClient(name="eureka-client",configuration= MyRule.class)
public class RibbonConfiguration {
    /**
     * 随机负载均衡策略
     * @return
     */
//    @Bean
//    public IRule defaultLBStrategy() {
//        return new RandomRule();
//    }
}
